package com.tkp.entity;

import lombok.Data;
import lombok.ToString;
import org.springframework.http.HttpStatus;

import java.util.Map;

/**
 * @Author: duk
 * @Date: 2021/11/11 17:21
 * @Description: 返回前端异常信息
 */
@ToString
@Data
public class HttpException {
    /**
     * 编码状态
     */
    private int httpStatus;
    /**
     * 异常信息
     */
    private Object msg;
    /**
     * 是否成功
     */
    private boolean isSucceed;

    public void setMsg(int httpStatus,Object msg){
        this.httpStatus = httpStatus;
        this.isSucceed = false;
        this.msg = msg;
    }

    /**
     * 初始化
     */
    public HttpException() {
        this.isSucceed = true;
        this.httpStatus = 200;
    }
}
